package com.itheima.controller;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.common.R;
import com.itheima.common.TokenHolder;
import com.itheima.domain.Category;
import com.itheima.exception.NoDataException;
import com.itheima.service.CategoryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    //分类下拉列表   这里简单实现了全部数据的查询
    @GetMapping("/list")
    public R<List<Category>> catagroyPulldown(){
        log.info("------下拉分类----");
        List<Category> list = categoryService.list();
        return R.success(list);
    }

}
